package ln.javatest.day01.demo03;

import ln.javatest.day01.demo02.JDBCUtils;
import org.springframework.jdbc.core.JdbcTemplate;

//JDBCTemplate入门
public class JDBCTemplateDemo01 {
    public static void main(String[] args) {
        //1.导入jar包
        //2.创建JDBCTemplate对象
        JdbcTemplate template = new JdbcTemplate(JDBCUtils.getDataSource());
        //3.调用方法
        //定义一个sql
        String sql = "update user set password = 123456 where id = ?";
        int count = template.update(sql, 3);//3表示给上面？赋值
        System.out.println(count);
    }
}
